const Goodslist = require('../../db').Goodslist

module.exports = {
    async find(ctx,next){
        let pageindex = ctx.query.pageindex
        
        try{
            let goodslistinfo = await Goodslist.find({},null).skip(8*(pageindex-1)).limit(8).sort({'id':1}).exec()
            
            ctx.body = {
                code: 200,
                msg: '获取信息成功',
                list: goodslistinfo
            }
        } catch(e){
            ctx.body = {
                code: 500,
                msg: '获取信息失败'
            }
        }
    }
}